package br.senai.sc.util;

import java.util.logging.Logger;

import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;

public class PhaseTracker implements PhaseListener {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static final String PHASE_PARAM = "br.senai.sc.util.phaseTracker.cphase";
	private static final Logger logger = Logger.getLogger("br.senai.sc.util.logger");
	private static String cphase = null;

	public void setPhase(String newValue) {
		cphase = newValue;
	}

	public PhaseId getPhaseId() {
		PhaseId phaseId = PhaseId.ANY_PHASE;
		return phaseId;
	}

	public void beforePhase(PhaseEvent e) {
		logger.info("BEFORE " + e.getPhaseId());
	}

	public void afterPhase(PhaseEvent e) {
		logger.info("AFTER " + e.getPhaseId());
	}
}
